// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   YouTube Analytics API Version v1beta1
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='http://developers.google.com/youtube/analytics/'>YouTube Analytics API</a>
 *      <tr><th>API Version<td>v1beta1
 *      <tr><th>API Rev<td>20170320 (809)
 *      <tr><th>API Docs
 *          <td><a href='http://developers.google.com/youtube/analytics/'>
 *              http://developers.google.com/youtube/analytics/</a>
 *      <tr><th>Discovery Name<td>youtubeAnalytics
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using YouTube Analytics API can be found at
 * <a href='http://developers.google.com/youtube/analytics/'>http://developers.google.com/youtube/analytics/</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.YouTubeAnalytics.v1beta1
{
    /// <summary>The YouTubeAnalytics Service.</summary>
    public class YouTubeAnalyticsService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1beta1";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public YouTubeAnalyticsService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public YouTubeAnalyticsService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            groupItems = new GroupItemsResource(this);
            groups = new GroupsResource(this);
            reports = new ReportsResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "youtubeAnalytics"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://www.googleapis.com/youtube/analytics/v1beta1/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return "youtube/analytics/v1beta1/"; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the YouTube Analytics API.</summary>
        public class Scope
        {
            /// <summary>Manage your YouTube account</summary>
            public static string Youtube = "https://www.googleapis.com/auth/youtube";

            /// <summary>View your YouTube account</summary>
            public static string YoutubeReadonly = "https://www.googleapis.com/auth/youtube.readonly";

            /// <summary>View and manage your assets and associated content on YouTube</summary>
            public static string Youtubepartner = "https://www.googleapis.com/auth/youtubepartner";

            /// <summary>View monetary and non-monetary YouTube Analytics reports for your YouTube content</summary>
            public static string YtAnalyticsMonetaryReadonly = "https://www.googleapis.com/auth/yt-analytics-monetary.readonly";

            /// <summary>View YouTube Analytics reports for your YouTube content</summary>
            public static string YtAnalyticsReadonly = "https://www.googleapis.com/auth/yt-analytics.readonly";

        }



        private readonly GroupItemsResource groupItems;

        /// <summary>Gets the GroupItems resource.</summary>
        public virtual GroupItemsResource GroupItems
        {
            get { return groupItems; }
        }

        private readonly GroupsResource groups;

        /// <summary>Gets the Groups resource.</summary>
        public virtual GroupsResource Groups
        {
            get { return groups; }
        }

        private readonly ReportsResource reports;

        /// <summary>Gets the Reports resource.</summary>
        public virtual ReportsResource Reports
        {
            get { return reports; }
        }
    }

    ///<summary>A base abstract class for YouTubeAnalytics requests.</summary>
    public abstract class YouTubeAnalyticsBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new YouTubeAnalyticsBaseServiceRequest instance.</summary>
        protected YouTubeAnalyticsBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>Data format for the response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for the response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of text/csv</summary>
            [Google.Apis.Util.StringValueAttribute("csv")]
            Csv,
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
        }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
        /// limits.</summary>
        [Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UserIp { get; set; }

        /// <summary>Initializes YouTubeAnalytics parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "userIp", new Google.Apis.Discovery.Parameter
                {
                    Name = "userIp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "groupItems" collection of methods.</summary>
    public class GroupItemsResource
    {
        private const string Resource = "groupItems";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public GroupItemsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Removes an item from a group.</summary>
        /// <param name="id">The id parameter specifies the YouTube group item ID for the group that is being
        /// deleted.</param>
        public virtual DeleteRequest Delete(string id)
        {
            return new DeleteRequest(service, id);
        }

        /// <summary>Removes an item from a group.</summary>
        public class DeleteRequest : YouTubeAnalyticsBaseServiceRequest<string>
        {
            /// <summary>Constructs a new Delete request.</summary>
            public DeleteRequest(Google.Apis.Services.IClientService service, string id)
                : base(service)
            {
                Id = id;
                InitParameters();
            }


            /// <summary>The id parameter specifies the YouTube group item ID for the group that is being
            /// deleted.</summary>
            [Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Id { get; private set; }

            /// <summary>Note: This parameter is intended exclusively for YouTube content partners.
            ///
            /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
            /// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
            /// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
            /// It allows content owners to authenticate once and get access to all their video and channel data,
            /// without having to provide authentication credentials for each individual channel. The CMS account that
            /// the user authenticates with must be linked to the specified YouTube content owner.</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "delete"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "DELETE"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "groupItems"; }
            }

            /// <summary>Initializes Delete parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "id", new Google.Apis.Discovery.Parameter
                    {
                        Name = "id",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Creates a group item.</summary>
        /// <param name="body">The body of the request.</param>
        public virtual InsertRequest Insert(Google.Apis.YouTubeAnalytics.v1beta1.Data.GroupItem body)
        {
            return new InsertRequest(service, body);
        }

        /// <summary>Creates a group item.</summary>
        public class InsertRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1beta1.Data.GroupItem>
        {
            /// <summary>Constructs a new Insert request.</summary>
            public InsertRequest(Google.Apis.Services.IClientService service, Google.Apis.YouTubeAnalytics.v1beta1.Data.GroupItem body)
                : base(service)
            {
                Body = body;
                InitParameters();
            }


            /// <summary>Note: This parameter is intended exclusively for YouTube content partners.
            ///
            /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
            /// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
            /// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
            /// It allows content owners to authenticate once and get access to all their video and channel data,
            /// without having to provide authentication credentials for each individual channel. The CMS account that
            /// the user authenticates with must be linked to the specified YouTube content owner.</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.YouTubeAnalytics.v1beta1.Data.GroupItem Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "insert"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "groupItems"; }
            }

            /// <summary>Initializes Insert parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Returns a collection of group items that match the API request parameters.</summary>
        /// <param name="groupId">The id parameter specifies the unique ID of the group for which you want to retrieve group
        /// items.</param>
        public virtual ListRequest List(string groupId)
        {
            return new ListRequest(service, groupId);
        }

        /// <summary>Returns a collection of group items that match the API request parameters.</summary>
        public class ListRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1beta1.Data.GroupItemListResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service, string groupId)
                : base(service)
            {
                GroupId = groupId;
                InitParameters();
            }


            /// <summary>The id parameter specifies the unique ID of the group for which you want to retrieve group
            /// items.</summary>
            [Google.Apis.Util.RequestParameterAttribute("groupId", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string GroupId { get; private set; }

            /// <summary>Note: This parameter is intended exclusively for YouTube content partners.
            ///
            /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
            /// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
            /// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
            /// It allows content owners to authenticate once and get access to all their video and channel data,
            /// without having to provide authentication credentials for each individual channel. The CMS account that
            /// the user authenticates with must be linked to the specified YouTube content owner.</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "groupItems"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "groupId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "groupId",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "groups" collection of methods.</summary>
    public class GroupsResource
    {
        private const string Resource = "groups";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public GroupsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Deletes a group.</summary>
        /// <param name="id">The id parameter specifies the YouTube group ID for the group that is being deleted.</param>
        public virtual DeleteRequest Delete(string id)
        {
            return new DeleteRequest(service, id);
        }

        /// <summary>Deletes a group.</summary>
        public class DeleteRequest : YouTubeAnalyticsBaseServiceRequest<string>
        {
            /// <summary>Constructs a new Delete request.</summary>
            public DeleteRequest(Google.Apis.Services.IClientService service, string id)
                : base(service)
            {
                Id = id;
                InitParameters();
            }


            /// <summary>The id parameter specifies the YouTube group ID for the group that is being deleted.</summary>
            [Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Id { get; private set; }

            /// <summary>Note: This parameter is intended exclusively for YouTube content partners.
            ///
            /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
            /// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
            /// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
            /// It allows content owners to authenticate once and get access to all their video and channel data,
            /// without having to provide authentication credentials for each individual channel. The CMS account that
            /// the user authenticates with must be linked to the specified YouTube content owner.</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "delete"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "DELETE"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "groups"; }
            }

            /// <summary>Initializes Delete parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "id", new Google.Apis.Discovery.Parameter
                    {
                        Name = "id",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Creates a group.</summary>
        /// <param name="body">The body of the request.</param>
        public virtual InsertRequest Insert(Google.Apis.YouTubeAnalytics.v1beta1.Data.Group body)
        {
            return new InsertRequest(service, body);
        }

        /// <summary>Creates a group.</summary>
        public class InsertRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1beta1.Data.Group>
        {
            /// <summary>Constructs a new Insert request.</summary>
            public InsertRequest(Google.Apis.Services.IClientService service, Google.Apis.YouTubeAnalytics.v1beta1.Data.Group body)
                : base(service)
            {
                Body = body;
                InitParameters();
            }


            /// <summary>Note: This parameter is intended exclusively for YouTube content partners.
            ///
            /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
            /// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
            /// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
            /// It allows content owners to authenticate once and get access to all their video and channel data,
            /// without having to provide authentication credentials for each individual channel. The CMS account that
            /// the user authenticates with must be linked to the specified YouTube content owner.</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.YouTubeAnalytics.v1beta1.Data.Group Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "insert"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "groups"; }
            }

            /// <summary>Initializes Insert parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Returns a collection of groups that match the API request parameters. For example, you can retrieve
        /// all groups that the authenticated user owns, or you can retrieve one or more groups by their unique
        /// IDs.</summary>
        public virtual ListRequest List()
        {
            return new ListRequest(service);
        }

        /// <summary>Returns a collection of groups that match the API request parameters. For example, you can retrieve
        /// all groups that the authenticated user owns, or you can retrieve one or more groups by their unique
        /// IDs.</summary>
        public class ListRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1beta1.Data.GroupListResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service)
                : base(service)
            {
                InitParameters();
            }


            /// <summary>The id parameter specifies a comma-separated list of the YouTube group ID(s) for the
            /// resource(s) that are being retrieved. In a group resource, the id property specifies the group's YouTube
            /// group ID.</summary>
            [Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Id { get; set; }

            /// <summary>Set this parameter's value to true to instruct the API to only return groups owned by the
            /// authenticated user.</summary>
            [Google.Apis.Util.RequestParameterAttribute("mine", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<bool> Mine { get; set; }

            /// <summary>Note: This parameter is intended exclusively for YouTube content partners.
            ///
            /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
            /// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
            /// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
            /// It allows content owners to authenticate once and get access to all their video and channel data,
            /// without having to provide authentication credentials for each individual channel. The CMS account that
            /// the user authenticates with must be linked to the specified YouTube content owner.</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }

            /// <summary>The pageToken parameter identifies a specific page in the result set that should be returned.
            /// In an API response, the nextPageToken property identifies the next page that can be retrieved.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string PageToken { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "groups"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "id", new Google.Apis.Discovery.Parameter
                    {
                        Name = "id",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "mine", new Google.Apis.Discovery.Parameter
                    {
                        Name = "mine",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "pageToken", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageToken",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Modifies a group. For example, you could change a group's title.</summary>
        /// <param name="body">The body of the request.</param>
        public virtual UpdateRequest Update(Google.Apis.YouTubeAnalytics.v1beta1.Data.Group body)
        {
            return new UpdateRequest(service, body);
        }

        /// <summary>Modifies a group. For example, you could change a group's title.</summary>
        public class UpdateRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1beta1.Data.Group>
        {
            /// <summary>Constructs a new Update request.</summary>
            public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.YouTubeAnalytics.v1beta1.Data.Group body)
                : base(service)
            {
                Body = body;
                InitParameters();
            }


            /// <summary>Note: This parameter is intended exclusively for YouTube content partners.
            ///
            /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
            /// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
            /// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
            /// It allows content owners to authenticate once and get access to all their video and channel data,
            /// without having to provide authentication credentials for each individual channel. The CMS account that
            /// the user authenticates with must be linked to the specified YouTube content owner.</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.YouTubeAnalytics.v1beta1.Data.Group Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "update"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "PUT"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "groups"; }
            }

            /// <summary>Initializes Update parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "reports" collection of methods.</summary>
    public class ReportsResource
    {
        private const string Resource = "reports";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public ReportsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Retrieve your YouTube Analytics reports.</summary>
        /// <param name="ids">Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics
        /// data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID
        /// specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the ids parameter
        /// value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner.</param>
        /// <param
        /// name="startDate">The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD
        /// format.</param>
        /// <param name="endDate">The end date for fetching YouTube Analytics data. The value should be
        /// in YYYY-MM-DD format.</param>
        /// <param name="metrics">A comma-separated list of YouTube Analytics metrics,
        /// such as views or likes,dislikes. See the Available Reports document for a list of the reports that you can retrieve
        /// and the metrics available in each report, and see the Metrics document for definitions of those
        /// metrics.</param>
        public virtual QueryRequest Query(string ids, string startDate, string endDate, string metrics)
        {
            return new QueryRequest(service, ids, startDate, endDate, metrics);
        }

        /// <summary>Retrieve your YouTube Analytics reports.</summary>
        public class QueryRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1beta1.Data.ResultTable>
        {
            /// <summary>Constructs a new Query request.</summary>
            public QueryRequest(Google.Apis.Services.IClientService service, string ids, string startDate, string endDate, string metrics)
                : base(service)
            {
                Ids = ids;
                StartDate = startDate;
                EndDate = endDate;
                Metrics = metrics;
                InitParameters();
            }


            /// <summary>Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics
            /// data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where
            /// CHANNEL_ID specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner,
            /// set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content
            /// owner.</summary>
            [Google.Apis.Util.RequestParameterAttribute("ids", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Ids { get; private set; }

            /// <summary>The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD
            /// format.</summary>
            [Google.Apis.Util.RequestParameterAttribute("start-date", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string StartDate { get; private set; }

            /// <summary>The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD
            /// format.</summary>
            [Google.Apis.Util.RequestParameterAttribute("end-date", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string EndDate { get; private set; }

            /// <summary>A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the
            /// Available Reports document for a list of the reports that you can retrieve and the metrics available in
            /// each report, and see the Metrics document for definitions of those metrics.</summary>
            [Google.Apis.Util.RequestParameterAttribute("metrics", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Metrics { get; private set; }

            /// <summary>The currency to which financial metrics should be converted. The default is US Dollar (USD). If
            /// the result contains no financial metrics, this flag will be ignored. Responds with an error if the
            /// specified currency is not recognized.</summary>
            [Google.Apis.Util.RequestParameterAttribute("currency", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Currency { get; set; }

            /// <summary>A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See
            /// the Available Reports document for a list of the reports that you can retrieve and the dimensions used
            /// for those reports. Also see the Dimensions document for definitions of those dimensions.</summary>
            [Google.Apis.Util.RequestParameterAttribute("dimensions", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Dimensions { get; set; }

            /// <summary>A list of filters that should be applied when retrieving YouTube Analytics data. The Available
            /// Reports document identifies the dimensions that can be used to filter each report, and the Dimensions
            /// document defines those dimensions. If a request uses multiple filters, join them together with a
            /// semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter
            /// value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in
            /// Italy.</summary>
            [Google.Apis.Util.RequestParameterAttribute("filters", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Filters { get; set; }

            /// <summary>If set to true historical data (i.e. channel data from before the linking of the channel to the
            /// content owner) will be retrieved.</summary>
            [Google.Apis.Util.RequestParameterAttribute("include-historical-channel-data", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<bool> IncludeHistoricalChannelData { get; set; }

            /// <summary>The maximum number of rows to include in the response.</summary>
            /// [minimum: 1]
            [Google.Apis.Util.RequestParameterAttribute("max-results", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> MaxResults { get; set; }

            /// <summary>A comma-separated list of dimensions or metrics that determine the sort order for YouTube
            /// Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort
            /// order.</summary>
            [Google.Apis.Util.RequestParameterAttribute("sort", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Sort { get; set; }

            /// <summary>An index of the first entity to retrieve. Use this parameter as a pagination mechanism along
            /// with the max-results parameter (one-based, inclusive).</summary>
            /// [minimum: 1]
            [Google.Apis.Util.RequestParameterAttribute("start-index", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> StartIndex { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "query"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "reports"; }
            }

            /// <summary>Initializes Query parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "ids", new Google.Apis.Discovery.Parameter
                    {
                        Name = "ids",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[a-zA-Z]+==[a-zA-Z0-9_+-]+",
                    });
                RequestParameters.Add(
                    "start-date", new Google.Apis.Discovery.Parameter
                    {
                        Name = "start-date",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9]{4}-[0-9]{2}-[0-9]{2}",
                    });
                RequestParameters.Add(
                    "end-date", new Google.Apis.Discovery.Parameter
                    {
                        Name = "end-date",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9]{4}-[0-9]{2}-[0-9]{2}",
                    });
                RequestParameters.Add(
                    "metrics", new Google.Apis.Discovery.Parameter
                    {
                        Name = "metrics",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9a-zA-Z,]+",
                    });
                RequestParameters.Add(
                    "currency", new Google.Apis.Discovery.Parameter
                    {
                        Name = "currency",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[A-Z]{3}",
                    });
                RequestParameters.Add(
                    "dimensions", new Google.Apis.Discovery.Parameter
                    {
                        Name = "dimensions",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9a-zA-Z,]+",
                    });
                RequestParameters.Add(
                    "filters", new Google.Apis.Discovery.Parameter
                    {
                        Name = "filters",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "include-historical-channel-data", new Google.Apis.Discovery.Parameter
                    {
                        Name = "include-historical-channel-data",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "max-results", new Google.Apis.Discovery.Parameter
                    {
                        Name = "max-results",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "sort", new Google.Apis.Discovery.Parameter
                    {
                        Name = "sort",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[-0-9a-zA-Z,]+",
                    });
                RequestParameters.Add(
                    "start-index", new Google.Apis.Discovery.Parameter
                    {
                        Name = "start-index",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }
}

namespace Google.Apis.YouTubeAnalytics.v1beta1.Data
{    

    public class Group : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("contentDetails")]
        public virtual Group.ContentDetailsData ContentDetails { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("etag")]
        public virtual string ETag { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("snippet")]
        public virtual Group.SnippetData Snippet { get; set; } 

        

        public class ContentDetailsData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("itemCount")]
            public virtual System.Nullable<ulong> ItemCount { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("itemType")]
            public virtual string ItemType { get; set; } 

        }    

        public class SnippetData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("publishedAt")]
            public virtual string PublishedAtRaw { get; set; }

            /// <summary><seealso cref="System.DateTime"/> representation of <see cref="PublishedAtRaw"/>.</summary>
            [Newtonsoft.Json.JsonIgnore]
            public virtual System.Nullable<System.DateTime> PublishedAt
            {
                get
                {
                    return Google.Apis.Util.Utilities.GetDateTimeFromString(PublishedAtRaw);
                }
                set
                {
                    PublishedAtRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
                }
            }

            [Newtonsoft.Json.JsonPropertyAttribute("title")]
            public virtual string Title { get; set; } 

        }
    }    

    public class GroupItem : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("etag")]
        public virtual string ETag { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("groupId")]
        public virtual string GroupId { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("resource")]
        public virtual GroupItem.ResourceData Resource { get; set; } 

        

        public class ResourceData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("id")]
            public virtual string Id { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("kind")]
            public virtual string Kind { get; set; } 

        }
    }    

    /// <summary>A paginated list of grouList resources returned in response to a youtubeAnalytics.groupApi.list
    /// request.</summary>
    public class GroupItemListResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("etag")]
        public virtual string ETag { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("items")]
        public virtual System.Collections.Generic.IList<GroupItem> Items { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

    }    

    /// <summary>A paginated list of grouList resources returned in response to a youtubeAnalytics.groupApi.list
    /// request.</summary>
    public class GroupListResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("etag")]
        public virtual string ETag { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("items")]
        public virtual System.Collections.Generic.IList<Group> Items { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

    }    

    /// <summary>Contains a single result table. The table is returned as an array of rows that contain the values for
    /// the cells of the table. Depending on the metric or dimension, the cell can contain a string (video ID, country
    /// code) or a number (number of views or number of likes).</summary>
    public class ResultTable : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>This value specifies information about the data returned in the rows fields. Each item in the
        /// columnHeaders list identifies a field returned in the rows value, which contains a list of comma-delimited
        /// data. The columnHeaders list will begin with the dimensions specified in the API request, which will be
        /// followed by the metrics specified in the API request. The order of both dimensions and metrics will match
        /// the ordering in the API request. For example, if the API request contains the parameters
        /// dimensions=ageGroup,gender=viewerPercentage, the API response will return columns in this order:
        /// ageGroup,gender,viewerPercentage.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("columnHeaders")]
        public virtual System.Collections.Generic.IList<ResultTable.ColumnHeadersData> ColumnHeaders { get; set; } 

        /// <summary>This value specifies the type of data included in the API response. For the query method, the kind
        /// property value will be youtubeAnalytics#resultTable.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The list contains all rows of the result table. Each item in the list is an array that contains
        /// comma-delimited data corresponding to a single row of data. The order of the comma-delimited data fields
        /// will match the order of the columns listed in the columnHeaders field. If no data is available for the given
        /// query, the rows element will be omitted from the response. The response for a query with the day dimension
        /// will not contain rows for the most recent days.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("rows")]
        public virtual System.Collections.Generic.IList<System.Collections.Generic.IList<object>> Rows { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        public class ColumnHeadersData
        {
            /// <summary>The type of the column (DIMENSION or METRIC).</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("columnType")]
            public virtual string ColumnType { get; set; } 

            /// <summary>The type of the data in the column (STRING, INTEGER, FLOAT, etc.).</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("dataType")]
            public virtual string DataType { get; set; } 

            /// <summary>The name of the dimension or metric.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("name")]
            public virtual string Name { get; set; } 

        }
    }
}
